Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Changing input type="number" - value changes, but not the front-end number

I'm working on an option tokenizer for Magento Bundle Product.

I have a input type=number that I want to change with jQuery / Javascript.

<input id="bundle-option-7-qty-input" class="input-text" type="number" value="1">

To change the value I do this:

$("#bundle-option-7-qty-input").attr('value', 99);

The value is changing within the HTML element, but the look of the element does not change the number.

<input id="bundle-option-7-qty-input" class="input-text" type="number" value="99">

Wrong front-end value

Should be this:

Correct front-end value

It seems like the value attribute is somehow disconnected from the front-end view of the element itself.

I have looked at MDN article on this element and could not find any attribute that would be responsible for the front-end change: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

Any ideas how I can change this element's front-end look value?

UPDATE:

I have tried .val() it has the same effect - this is some kind of issue with input type="number"

If you create HTML file with:

And within the Chrome console change the value to 99

The front-end will still show 1:

input type ="number" after HTML element change in Chrome console

UPDATE: it looks like Magento 2 might be changing value property after / before I make the change with jQuery.

Is there a way to detect / block this change?

UPDATE: for now just putting setting timeout and then changing the input seems to work.

I'll see if I can detect the value change.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!